package com.luhy.mapper;

import com.luhy.pojo.Order;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface OrderMapper {

    @Select("select * from rt_order")
    List<Order> selectAll();

    @Insert("insert into rt_order value(#{orderNo},#{course},#{cost},#{status})")
    void insert(Order order);

    @Update("update rt_order set status=#{status} where orderNo=#{orderNo}")
    void updateStatus(String orderNo, int status);

    @Select("select * from rt_order where orderNo = #{orderNo}")
    Order selectByOrderNo(String orderNo);
}
